const adminModel = require('../../model/admin/admin')


exports.getAdminInfo = async ctx => {
    let token = ctx.request.query.token
    await adminModel.findAdminInfoByTocken(token)
        .then(res => {
            console.info(res)
            ctx.body = {
                access: ['super_admin', 'admin'],
                token: res[0]['name'],
                nmae: res[0]['name'],
                user_id: res[0]['id'],
                avatar: 'https://file.iviewui.com/dist/a0e88e83800f138b94d2414621bd9704.png',
                code: 0,
                msg: '获取成功'
            }
        })
        .catch(err => {
            ctx.body = {
                msg: err,
                code: -2
            }
        })
}



